import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'

// https://vite.dev/config/
export default defineConfig({
  plugins: [vue()],
  // 修改全局变量定义方式，避免与window对象冲突
  define: {
    'process.env': {},
    global: 'globalThis'
  },
  // 服务器端口号
  server: {
    port: 8081
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src')
    }
  },
  // 简化构建配置
  build: {
    assetsDir: 'assets'
  }
})
